package yt.kpool.adapter;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import com.king.base.adapter.ViewHolderRecyclerAdapter;
import com.king.base.adapter.holder.ViewHolder;

import java.text.DecimalFormat;
import java.util.List;

import yt.kpool.R;
import yt.kpool.activity.salesman.AgentDetailsActivity;
import yt.kpool.bean.MyAgentBean;
import yt.kpool.bean.MySalaryBean;
import yt.kpool.util.Util;


/**
 * 业务员我的工资列表
 */
public class SalemanMySalaryAdapter extends ViewHolderRecyclerAdapter<MySalaryBean.DataBean.RowsBean> {
    private Context context;
    public SalemanMySalaryAdapter(Context context, List<MySalaryBean.DataBean.RowsBean> data) {
        super(context, data);

        this.context=context;

    }
    @Override
    public View buildConvertView(LayoutInflater layoutInflater, int viewType) {
        return layoutInflater.inflate(R.layout.item_saleman_salary,null);
    }

    @Override
    public void bindViewDatas(ViewHolder holder, final MySalaryBean.DataBean.RowsBean dataBean, int position) {
        holder.setText(R.id.tv_UserName,dataBean.getUserName());
        DecimalFormat df = new DecimalFormat("#####0.00000000");

        holder.setText(R.id.tv_Amount,df.format(dataBean.getAmount()));
        DecimalFormat df2 = new DecimalFormat("#####0.00");
        holder.setText(R.id.tv_CoinPrice,"￥"+df2.format(dataBean.getCoinPrice()));
        holder.setText(R.id.tv_InterfaceStaffAmount,df.format(dataBean.getInterfaceStaffAmount()));
        holder.setText(R.id.tv_InterfaceStaffSalary,"￥"+df2.format(dataBean.getInterfaceStaffSalary()));
        holder.setText(R.id.tv_ChildAccountName,dataBean.getChildAccountName());
        holder.setText(R.id.tv_Date,dataBean.getDate());



    }


}
